package com.mq.topic;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author ytj
 * @date 2024/1/15
 */
@Component
@RabbitListener(queues = Demo2Message.QUEUE_NAME)
public class Demo2Consumer {

    @RabbitHandler
    public void onMessage(Demo2Message message) {
        System.out.println("接收到消息: " + message.getId());
    }
}
